<?php
/**
 * Created by IntelliJ IDEA.
 * User: wanglu
 * Date: 17/4/12
 * Time: 17:43
 */
class Key_model extends BaseModel {



    function __construct()
    {
        parent::__construct(Db_model::TABLE_PROJECT_KEY);
    }


    public function batch_update_order($pid, $key_sorts = array() ) {
        return $this->db->where('pid', $pid)->update_batch(Db_model::TABLE_PROJECT_KEY, $key_sorts, 'pkey');
    }


    public function get_pkeys($pid) {
        return $this->getRecords(array('pid'=> $pid), array('display_order'=> 'ASC', "createtime", "ASC"));
    }

}